package com.hq.myvideo;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import org.jetbrains.annotations.NotNull;

import java.util.List;

public class VideoPagerAdapter extends  FragmentStatePagerAdapter {
    private List<String> videoUrls;

    public VideoPagerAdapter(@NonNull @NotNull FragmentManager fm,List<String> path) {
        super(fm);
        this.videoUrls=path;
    }

    @NonNull
    @NotNull
    @Override
    public Fragment getItem(int position) {
        return PlayFullFragment.newInstance(videoUrls.get(position));
    }

    @Override
    public int getCount() {
        return this.videoUrls.size();
    }
}
